Intra-prediction method, and encoder and decoder using same

ABSTRACT

The present invention relates to an intra-prediction method and to an encoder and decoder using same. The intra-prediction method according to one embodiment of the present invention comprises the steps of: deriving a prediction mode of a current block; and generating a prediction block with respect to the current block on the basis of the prediction mode of the current block. When the prediction mode of the current block is an intra-angular prediction mode, values of boundary samples from among left boundary samples and upper boundary samples of the prediction block, which are not positioned in a prediction direction of the intra-angular prediction mode, are derived on the basis of reference samples positioned in the prediction direction of the intra-angular prediction mode, and on the basis of adjacent reference samples.

TECHNICAL FIELD

The present invention relates to an intra prediction method in a videoencoder and a video decoder, and more particularly, to a method ofderiving a value of a specific boundary sample of a predicted block of acurrent block and a device using the method.

BACKGROUND ART

In recent years, demands for a high-resolution and high-quality videohave increased in various fields of applications. However, as a videohas a higher resolution and higher quality, an amount of data on thevideo increases more and more.

When a high-resolution and high-quality video with a large amount ofdata is transferred using media such as existing wired or wirelessbroadband lines or is stored in existing storage media, the transfercost and the storage cost thereof increase. Accordingly, in order toeffectively transfer, store, and reproduce the high-resolution andhigh-quality video, high-efficiency video compressing techniques can beutilized.

In order to enhance video compression efficiency, an inter predictionmethod and an intra prediction method can be used.

In the inter prediction, pixel values of a current picture are predictedfrom temporally previous and/or subsequent pictures. In the intraprediction, pixel values of a current picture are predicted usinginter-pixel relationships in the same picture. In the intra prediction,pixel values of a current picture are predicted using pixel informationof the current picture.

In addition to the inter prediction and the intra prediction, weightprediction for preventing degradation in quality due to illuminationvariations or the like, entropy encoding of allocating a short code to asymbol having a high appearance frequency and allocating a long code toa symbol having a low appearance frequency, and the like can be used.

SUMMARY OF THE INVENTION Technical Problem

An object of the invention is to provide an effective video compressiontechnique and a device using the technique.

Another object of the invention is to provide an intra prediction methodthat can enhance prediction efficiency and a device using the method.

Another object of the invention is to provide a method of deriving avalue of a specific boundary sample of a predicted block of a currentblock and a device using the method.

Solution to Problem

According to an aspect of the invention, there is provided an intraprediction method. The intra prediction method includes the steps ofderiving a prediction mode of a current block; and constructing apredicted block of the current block on the basis of the predictionmode. When the prediction mode is an Intra directional prediction mode(Intra_Angular prediction mode), a value of a boundary sample notlocated in the prediction direction of the Intra directional predictionmode (Intra_Angular prediction mode) out of a left boundary sample and atop boundary sample of the predicted block is derived on the basis of areference sample located in the prediction direction and a referencesample adjacent to the boundary sample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a vertical prediction mode, a value of the left boundary samplemay be derived on the basis of a top reference sample of the leftboundary sample and a reference sample adjacent to the left boundarysample. A value of a predicted sample other than the left boundarysample may be derived to be a value of the top reference sample of thepredicted sample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a vertical prediction mode, a value of the left boundary samplemay be derived on the basis of a top reference sample of the leftboundary sample, a reference sample adjacent to the left boundarysample, and a reference sample neighboring to the left-top edge of thecurrent block.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a horizontal prediction mode, a value of the top boundarysample may be derived on the basis of a left reference sample of the topboundary sample and a reference sample adjacent to the top boundarysample. A value of a predicted sample other than the top boundary samplemay be derived to be a value of a left reference sample of the predictedsample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a horizontal prediction mode, a value of the top boundarysample may be derived on the basis of a left reference sample of the topboundary sample, a reference sample adjacent to the top boundary sample,and a reference sample neighboring to the left-top edge of the currentblock.

When the prediction direction is a top-right direction, a value of theleft boundary sample may be derived on the basis of a reference samplelocated in the prediction direction and a reference sample adjacent tothe left boundary sample.

When the prediction direction is a left-bottom direction, a value of thetop boundary sample may be derived on the basis of a reference samplelocated in the prediction direction and a reference sample adjacent tothe top boundary sample.

According to another aspect of the invention, there is provided a videoencoder. The video encoder includes a prediction module that constructsa predicted block of a current block on the basis of a prediction modeof the current block; and an entropy encoding module that encodesinformation on the predicted block. When the prediction mode is an Intradirectional prediction mode (Intra_Angular prediction mode), theprediction module derives a value of a boundary sample not located inthe prediction direction of the Intra directional prediction mode(Intra_Angular prediction mode) out of a left boundary sample and a topboundary sample of the predicted block on the basis of a referencesample located in the prediction direction and a reference sampleadjacent to the boundary sample.

According to still another aspect of the invention, there is provided avideo decoder. The video decoder includes: an entropy decoding modulethat entropy-decodes information received from an encoder; and aprediction module that constructs a predicted block of a current blockon the basis of the entropy-decoded information. When the predictionmode of the current block is an Intra directional prediction mode(Intra_Angular prediction mode), the prediction module derives a valueof a boundary sample not located in the prediction direction of theIntra directional prediction mode (Intra_Angular prediction mode) out ofa left boundary sample and a top boundary sample of the predicted blockon the basis of a reference sample located in the prediction directionand a reference sample adjacent to the boundary sample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a vertical prediction mode, the prediction module may derive avalue of the left boundary sample on the basis of a top reference sampleof the left boundary sample and a reference sample adjacent to the leftboundary sample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a vertical prediction mode, the prediction module may derive avalue of the left boundary sample on the basis of a top reference sampleof the left boundary sample, a reference sample adjacent to the leftboundary sample, and a reference sample neighboring to the left-top edgeof the current block.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a horizontal prediction mode, the prediction module may derivea value of the top boundary sample on the basis of a left referencesample of the top boundary sample and a reference sample adjacent to thetop boundary sample.

When the Intra directional prediction mode (Intra_Angular predictionmode) is a horizontal prediction mode, the prediction module may derivea value of the top boundary sample on the basis of a left referencesample of the top boundary sample, a reference sample adjacent to thetop boundary sample, and a reference sample neighboring to the left-topedge of the current block.

Advantageous Effects

According to the invention, it is possible to enhance intra predictionefficiency and to improve video compression performance.

According to the invention, it is possible to enhance accuracy of avalue of a predicted sample located adjacent to a reference sample.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram schematically illustrating a video encoderaccording to an embodiment of the invention.

FIG. 2 is a block diagram schematically illustrating a video decoderaccording to an embodiment of the invention.

FIG. 3 is a flowchart schematically illustrating an intra predictionmethod in the video decoder.

FIG. 4 is a diagram illustrating prediction directions in an intraprediction mode.

FIG. 5 is a diagram illustrating an example where a current block isencoded in an Intra_DC prediction mode.

FIG. 6 is a diagram illustrating an example where the predictiondirection is vertical in an intra prediction mode according to anembodiment of the invention.

FIG. 7 is a diagram illustrating an example where the predictiondirection is horizontal in an intra prediction mode according to anembodiment of the invention.

FIG. 8 is a diagram illustrating an example where the intra predictionmodes are classified depending on the prediction directions.

FIG. 9 is a diagram illustrating an example where the predictiondirection is a top-right direction in an intra prediction mode accordingto an embodiment of the invention.

FIG. 10 is a diagram illustrating an example where the predictiondirection is a left-bottom direction in an intra prediction modeaccording to an embodiment of the invention.

FIG. 11 is a diagram illustrating an example where the predictiondirection is vertical in an intra prediction mode according to anotherembodiment of the invention.

FIG. 12 is a diagram illustrating an example where the predictiondirection is horizontal in an intra prediction mode according to anotherembodiment of the invention.

FIG. 13 is a diagram schematically illustrating operations of an encoderin a system according to the invention.

FIG. 14 is a diagram schematically illustrating operations of a decoderin a system according to the invention.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The invention can have various embodiments and specific embodimentsthereof will be described in detail with reference to the accompanyingdrawings. However, the invention is not limited to the specificembodiments and can be modified in various forms without departing fromthe technical scope of the invention.

Terms used in the below description are used to merely describe specificembodiments, but are not intended for limiting the technical spirit ofthe invention. An expression of a singular number includes an expressionof a plural number, so long as it is clearly read differently.

On the other hand, elements in the drawings described in the inventionare independently drawn for the purpose of convenience for explanationof different specific functions in a video encoder/decoder and does notmean that the respective elements are embodied by independent hardwareor independent software. For example, two or more of the elements may becombined to form a single element, or one element may be divided intoplural elements. The embodiments in which the elements are combinedand/or divided belong to the scope of the invention without departingfrom the concept of the invention.

Hereinafter, exemplary embodiments of the invention will be described indetail with reference to the accompanying drawings. Like constituents inthe drawings will be referenced by like reference numerals and will notbe repeatedly described.

FIG. 1 is a block diagram schematically illustrating a video encoderaccording to an embodiment of the invention. Referring to FIG. 1, avideo encoder 100 includes a picture dividing module 105, a predictionmodule 110, a transform module 115, a quantization module 120, arearrangement module 125, an entropy encoding module 130, adequantization module 135, an inverse transform module 140, a filtermodule 145, and a memory 150.

The picture dividing module 105 may divide an input picture into one ormore process units. Here, the process unit may be a prediction unit(“PU”), a transform unit (“TU”), or a coding unit (“CU”).

The prediction module 110 includes an inter prediction module thatperforms an inter prediction process and an intra prediction module thatperforms an intra prediction process. The prediction module 110 performsa prediction process on the process units of a picture divided by thepicture dividing module 105 to construct a predicted block. Here, theprocess unit of a picture may be a CU, a TU, or a PU. The predictionmodule 110 determines whether the inter prediction or the intraprediction will be performed on the corresponding process unit, andperforms a prediction process using the determined prediction method.Here, the process unit subjected to the prediction process may bedifferent from the process unit of which the prediction method isdetermined. For example, the prediction method may be determined in theunits of PU and the prediction process may be performed in the units ofTU.

In the inter prediction, the prediction process is performed on thebasis of information on at least one of a previous picture and/or asubsequent picture of a current picture to construct a predicted block.In the intra prediction, the prediction process is performed on thebasis of pixel information of a current picture to construct a predictedblock.

In the inter prediction, a reference picture is selected for a currentblock and a reference block with the same size as the current isselected in the units of inter pixel samples. Subsequently, a predictedblock in which a residual value from the current block is minimized andthe motion vector magnitude is minimized is constructed. In the interprediction, a skip mode, a merge mode, an MVP (Motion Vector Prediction)mode, and the like may be used. The predicted block may be constructedin the unit of pixel samples such as ½ pixel samples and ¼ pixel samplesless than an integer pixel. Here, the motion vector may also beexpressed in the unit of pixel samples less than an integer pixel. Forexample, lama components may be expressed in the unit of ¼ pixels andchroma components may be expressed in the unit of ⅛ pixels. Theinformation such as an index of a reference picture selected through theinter prediction, a motion vector, and a residual signal isentropy-encoded and is transmitted to the decoder.

In the intra prediction, the prediction mode may be determined byprediction units and the prediction process may be performed byprediction units or transform unit. In the intra prediction, 33directional prediction modes and at least two non-directional modes maybe supported. Here, the non-directional prediction modes may include aDC prediction mode and a planar mode.

On the other hand, when a sample is used in this specification, it meansthat information of the sample, for example, a pixel value, is used. Forthe purpose of convenience for explanation, an expression “sampleinformation is used” or “a pixel value is used” may be simply expressedby “a sample is used”.

A prediction unit may have various sizes/shapes. For example, in case ofinter prediction, the prediction unit may have sizes such as 2N×2N,2N×N, N×2N, and N×N. In case of intra prediction, the prediction unitmay have sizes such as 2N×N and N×N. Here, the prediction unit having asize of N×N may be set to be used for only a specific case. For example,the prediction unit having a size of N×N may be set to be used for onlya coding unit having the smallest size or may be set to be used for onlythe intra prediction. In addition to the prediction units having theabove-mentioned sizes, prediction units having sizes such as N×mN, mN×N,2N×mN, and mN×2N (where m<1) may be additionally defined and used.

A residual block between the constructed predicted block and theoriginal block is input to the transform module 115. Information such asthe prediction mode, the prediction unit, and the motion vector used forthe prediction is entropy-encoded by the entropy encoding module 130 andis transmitted to the decoder.

The transform module 115 performs a transform process on the residualblock and creates transform coefficients. The process unit in thetransform module 115 may be a transform unit and may have a quad treestructure. The size of the transform unit may be determined within apredetermined range of the largest and smallest sizes. The transformmodule 115 may transform the residual block using a DCT (Discrete CosineTransform) and/or a DST (Discrete Sine Transform).

The quantization module 120 quantizes the transform coefficients createdby the transform module 115 and creates quantization coefficients. Thequantization coefficients created by the quantization module 120 aresupplied to the rearrangement module 125 and the dequantization module135.

The rearrangement module 125 may rearrange the quantization coefficientssupplied from the quantization module 120. By rearranging thequantization coefficients, it is possible to enhance the encodingefficiency in the entropy encoding module 130. The rearrangement module125 rearranges the quantization coefficients in the form of atwo-dimensional block to the form of a one-dimensional vector throughthe use of a coefficient scanning method. The rearrangement module 125may enhance the entropy encoding efficiency in the entropy encodingmodule 130 by changing the order of coefficient scanning on the basis ofstochastic statistics of the quantization coefficients supplied from thequantization module 120.

The entropy encoding module 130 performs an entropy encoding process onthe quantization coefficients rearranged by the rearrangement module125. Here, encoding methods such as an exponential golomb method and aCABAC (Context-Adaptive Binary Arithmetic Coding) method may be used.The entropy encoding module 130 encodes a variety of information such asblock type information, prediction mode information, division unitinformation, prediction unit information, transfer unit information,motion vector information, reference picture information, blockinterpolation information, and filtering information transmitted fromthe prediction module 110.

The entropy encoding module 130 may give a predetermined change to aparameter set or a syntax to be transmitted, if necessary.

The dequantization module 135 dequantizes the values quantized by thequantization module 120. The inverse transform module 140 inverselytransforms the values dequantized by the dequantization module 135. Theresidual block reconstructed by the dequantization module 135 and theinverse transform module 140 is added to the predicted block constructedby the prediction module 110 to construct a reconstructed block.

The filter module 145 applies a deblocking filter, an ALF (Adaptive LoopFilter), an SAO (Sample Adaptive Offset), or the like to thereconstructed picture.

The deblocking filter removes block distortion generated at the boundarybetween blocks in the reconstructed picture. The ALF performs afiltering process on the basis of the resultant values of comparison ofthe original picture with the reconstructed picture is filtered by thedeblocking filter. The ALF may be applied only when high efficiency isnecessary. The SAO reconstructs offset differences between the residualblock having the deblocking filter applied thereto and the originalpicture in the unit of pixels, and is applied in the form of a bandoffset, an edge offset, or the like.

On the other hand, a reconstructed block used for the inter predictionmay not be subjected to a filtering process.

The memory 150 stores the reconstructed block or picture. Thereconstructed block or picture stored in the memory 150 is supplied tothe prediction module 110 that performs the inter prediction.

FIG. 2 is a block diagram schematically illustrating a video decoderaccording to an embodiment of the invention. Referring to FIG. 2, avideo decoder 200 includes an entropy decoding module 210, arearrangement module 215, a dequantization module 220, an inversetransform module 225, a prediction module 230, a filter module 235, anda memory 240.

When a video bitstream is input from the encoder, the input bitstreammay be decoded on the basis of the order in which video information isprocessed by the video encoder.

For example, when the video encoder uses a CAVLC to perform the entropyencoding process, the entropy decoding module 210 performs the entropydecoding process using the CABAC to correspond thereto.

The residual signal entropy-decoded by the entropy decoding module 210is supplied to the rearrangement module 215, and information forconstructing a predicted block out of the information entropy-decoded bythe entropy decoding module 210 is supplied to the prediction module230.

The rearrangement module 215 rearranges the bitstream entropy-decoded bythe entropy decoding module 210 on the basis of the rearrangement methodused in the video encoder. The rearrangement module 215 is supplied withthe information associated with the coefficient scanning performed bythe encoder and reconstructs and rearranges the coefficients expressedin the form of a one-dimensional vector to the coefficients in the formof a two-dimensional block by inversely performing the scanning on thebasis of the scanning order in which the scanning is performed by theencoder.

The dequantization module 220 performs dequantization on the basis ofthe quantization parameters supplied from the encoder and the rearrangedcoefficient values of the block.

The inverse transform module 225 performs the inverse transform of thetransform performed by the transform module of the encoder. The inversetransform may be performed on the basis of a transfer unit or a divisionunit determined by the encoder. The transform module of the encoder mayselectively perform the DCT and DST depending on plural pieces ofinformation such as the prediction method, the size of the currentblock, and the prediction direction, and the inverse transform module225 of the decoder may perform the inverse transform on the basis of thetransform information on the transform performed by the transform moduleof the encoder.

The prediction module 230 constructs a predicted block on the basis ofpredicted block construction information supplied from the entropydecoding module 210 and the previously-decoded block and/or pictureinformation supplied from the memory 240. The reconstructed block isconstructed on the basis of the predicted block constructed by theprediction module 230 and the residual block supplied from the inversetransform module 225. For example, when a current block is encoded in aninter prediction mode, the inter prediction is performed on the currentprediction unit on the basis of information included in at least one ofa previous picture and a subsequent picture of the current picture.Here, motion information necessary for the inter prediction, such as amotion vector and a reference picture index, may be derived from a skipflag, a merge flag, and the like supplied from the encoder.

The reconstructed block and/or picture may be supplied to the filtermodule 235. The filter module 235 performs a deblocking filteringprocess, an SAO (Sample Adaptive Offset) process, and/or an adaptiveloop filtering process on the reconstructed block and/or picture.

The reconstructed picture or block may be stored in the memory 240 foruse as a reference picture or a reference block and may be supplied toan output module (not shown).

On the other hand, the encoder encodes an encoding target block usingthe most efficient encoding method on the basis of video information ofthe encoding target block, and the decoder determines the decodingmethod on the basis of the encoding method used in the encoder. Theencoding method used in the encoder may be derived from the bitstreamtransmitted from the encoder or on the basis of the information of adecoding target block. When a current block is encoded in an intraprediction mode, the intra prediction of constructing a predicted blockis performed on the basis of pixel information of the current picture.

FIG. 3 is a flowchart schematically illustrating an intra predictionmethod in a video decoder.

The decoder derives a prediction mode of a current block (S310).

An intra prediction mode may have a prediction direction depending onpositions of reference samples used for the prediction. The intraprediction mode having a prediction direction is referred to as an intradirectional prediction mode (Intra_Angular prediction mode). On thecontrary, examples of an intra prediction mode not having a predictiondirection include an Intra_Planar prediction mode, an Intra_DCprediction mode, and an Intra_Fromlum prediction mode.

FIG. 4 illustrates prediction directions in the intra prediction modesand Table 1 shows mode values of the intra prediction modes illustratedin FIG. 4.

TABLE 1 Intra prediction mode Associated names 0 Intra_Planar 1 Intra_DC2 . . . 34 Intra_Angular 35  Intra_FromLima

In the intra prediction, a prediction process is performed on a currentblock on the basis of the derived prediction mode. The reference samplesand the specific prediction method used for the prediction varydepending on the prediction modes. Accordingly, when the current blockis encoded in an intra prediction mode, the decoder derives theprediction mode of the current block to perform the prediction.

The decoder may check whether neighboring samples of the current blockcan be used for the prediction, and may construct reference samples tobe used for the prediction (S320). In the intra prediction, theneighboring samples of the current block mean samples with a length of2*nS adjacent to the left boundary and the left-bottom edge of thecurrent block with a size of nS×nS and samples with a length of 2*nSadjacent to the top boundary and the top-right edge of the currentblock. However, some of the neighboring samples of the current block maynot be decoded yet or may not be available. In this case, the decodermay construct reference samples to be used for the prediction bysubstituting the non-available samples with the available sample.

The decoder may perform a filtering on the reference samples on thebasis of the prediction mode (S330). The decoder may perform thefiltering process on the reference samples before performing theprediction. Whether the reference samples should be subjected to thefiltering process is determined depending on the prediction mode of thecurrent block. The filtering adaptively performed on the referencesamples depending on the prediction mode is referred to as MIDIS (ModeDependent Intra Smoothing) or simply referred to as smoothing filtering.

Table 2 shows an example where it is determined whether the referencesamples should be subjected to the filtering on the basis of theprediction mode.

TABLE 2 intraFilterType intraFilterType intraFilterType intraFilterTypeintraFilterType IntraPredMode for nS = 4 for nS = 8 for nS = 16 for nS =32 for nS = 64 Intra_Planar 0 1 1 1 0 Intra_DC 0 0 0 0 0  2 0 1 1 1 03-8 0 0 1 1 0  9 0 0 0 1 0 Intra_Horizontal 0 0 0 0 0 11 0 0 0 1 0 12-170 0 1 1 0 18 0 1 1 1 0 19-24 0 0 1 1 0 25 0 0 0 1 0 Intra_Vertical 0 0 00 0 27 0 0 0 1 0 28-33 0 0 1 1 0 34 0 1 1 1 0 Intra_FromLuma 0 1 1 1 0

When intraFilterType equals to 1 in Table 2, the smoothing filtering isperformed. For example, when intraPredMode is an Intra_Planar mode andnS=8 is established, the smoothing filtering may be performed. At thistime, smoothing filters having various filtering coefficients may beapplied. For example, a smoothing filtering having a coefficient of [1 21] may be applied.

The decoder constructs a predicted block of the current block on thebasis of the prediction mode and the reference samples (S340). Thedecoder constructs the predicted block of the current block on the basisof the prediction mode derived in the prediction mode deriving step(S310) and the reference samples acquired in the reference samplefiltering step (S330).

In the predicted block constructing step (S340), when the current blockis encoded in the Intra_DC prediction, the left boundary samples and thetop boundary samples of the predicted block may be subjected to 2-tapfiltering so as to minimize discontinuity of the block boundary. Here,the boundary samples mean samples which are located in the predictedblock and which are adjacent to the boundary of the predicted block.

FIG. 5 is a diagram illustrating an example where a current block isencoded in the Intra_DC prediction mode.

Referring to FIG. 5, when a current block 500 is encoded in the Intra_DCprediction mode, left boundary samples 522 and top boundary samples 521of the current block 500 may be highly similar to left reference samples530 and top reference samples 510, respectively, and thus a smoothingfilter may be applied as illustrated in FIG. 5. In the drawing, thegraded portion 505 represents a filtering target area.

In some modes of the intra directional prediction modes, the 2-tapfiltering may be applied to the left boundary samples and the topboundary samples, similarly to the Intra_DC prediction mode. Here, the2-tap filtering is not applied to both the left boundary samples and thetop boundary samples, but is adaptively applied to the left boundarysamples or the top boundary samples depending on the predictiondirection. That is, the 2-tap filtering is applied to only the boundarysamples adjacent to the reference samples actually not used for thedirectional prediction.

Specifically, in the predicted block constructing step (S340), when thecurrent block is encoded in an intra directional prediction mode, thevalues of the predicted samples may be derived from the referencesamples located in the prediction direction. Here, in some modes of theintra directional prediction modes, the boundary samples not located inthe prediction direction out of the left boundary samples and the topboundary samples of the predicted block may be adjacent to referencesamples not used for the prediction. That is, the distance to thereference samples not used for the prediction may be much smaller thanthe distance to the reference samples used for the prediction. Sincethere is a high possibility that the values of the predicted samples aresimilar to the reference samples having the smaller distances, thefiltering is applied to the reference samples adjacent to the boundarysamples not located in the prediction direction out of the left boundarysamples and the top boundary samples in the invention so as to enhanceprediction performance and encoding efficiency.

For the purpose of convenience for explanation, the procedure ofderiving the values of the predicted samples in the intra directionalprediction modes will be described in two steps of a step of derivingthe values of the reference samples located in the prediction directionas the values of the predicted samples and a step of filtering andmodifying the boundary samples not located in the prediction directionout of the left boundary samples and the top boundary samples of thepredicted block. [x, y] coordinates of which the coordinate valuesincrease in the right-bottom direction are set with respect to theleft-top sample of the current block and the predicted block. The sizeof the current block and the predicted block is defined as nS. Forexample, the left-top boundary sample of the predicted block has aposition of [0, 0], the left boundary samples have positions of [0, 0 .. . nS−1], and the top boundary samples have positions of [0 . . . nS−1,0].

First, the values of the predicted samples are derived on the basis ofthe reference samples located in the prediction direction.

For example, when the current block is encoded in a vertical predictionmode, the values of the predicted samples are derived to be the valuesof the samples having the same x coordinate out of the reference samplesneighboring to the top boundary of the current block. That is, thevalues predSamples[x, y] of the predicted samples are derived byExpression 1.

predSamples[x,y]=p[x,−1], with x,y=0 . . . nS−1  Expression 1

Here, p[a, b] represents the value of a sample having a position of [a,b].

For example, when the current block is encoded in a horizontalprediction mode, the values of the predicted samples are derived to bethe values of the samples having the same y coordinate out of thereference samples neighboring to the left boundary of the current block.That is, the values predSamples[x, y] of the predicted samples arederived by Expression 2.

predSamples[x,y]=p[−1,y], with x,y=0 . . . nS−1  Expression 2

For example, when the current block is encoded in an intra directionalprediction mode of the prediction direction is a top-right direction,the values of the predicted samples are derived to be the values of thereference samples located in the prediction direction out of thereference samples adjacent to the top boundary of the current block andthe reference sample located at the top-right edge.

For example, when the current block is encoded in an intra directionalprediction mode of the prediction direction is a left-bottom direction,the values of the predicted samples are derived to be the values of thereference samples located in the prediction direction out of thereference samples adjacent to the left boundary of the current block andthe reference sample located at the left-bottom edge.

By deriving the values of the predicted samples on the basis of thereference samples located in the prediction direction and then filteringthe boundary samples not located in the prediction direction out of theleft boundary samples and the top boundary samples of the predictedblock on the basis of the adjacent reference samples, it is possible tomodify the values of the corresponding boundary samples. The method offiltering the boundary samples not located in the prediction directionout of the left boundary samples and the top boundary samples of thepredicted block using the reference samples not located in theprediction direction will be described below in detail with reference toFIGS. 5 to 13.

FIG. 6 is a diagram illustrating an example where the predictiondirection of an intra prediction mode according to an embodiment of theinvention is vertical.

Referring to FIG. 6, in case of a vertical prediction mode(Intra-Vertical prediction mode), a smoothing filter may be applied toleft boundary samples 620.

As described above, when a current block 600 is encoded in the verticalprediction mode, the values of the predicted samples are derived to bethe values of the top reference samples. Here, the reference samplesneighboring to the left boundary of the current block 600 are not usedfor the directional prediction, but are adjacent to the left boundarysamples of the current block 600. That is, in the left boundary samples620, the distance to the left reference samples 630 which are referencesamples not used for the prediction is smaller than the distance to thetop reference samples 610 which are reference samples used for theprediction. Here, the top reference samples 610 mean samples [x, −1]which are neighboring to the top boundary of the current block and whichhave the same x coordinate. The left reference samples 630 mean samples[−1, y] which are neighboring to the left boundary of the current blockand which have the same y coordinate. Therefore, since there is a highpossibility that the values of the left boundary samples 620 are similarto the values of the left reference samples 630, the smoothing filtermay be applied to the left boundary samples 620 as illustrated in FIG.6. The shaded portion 605 in the drawing represents a filtering targetarea.

For example, when a smoothing filter having a coefficient of [1 1]/2 isapplied, the modified values predSamples[x, y] of the left boundarysamples 620 can be derived by Expression 3.

predSamples[x,y]=(p[x,−1]+p[−1,y])/2, with x=0, y=0 . . .nS−1  Expression 3

The coefficient of the filter is not limited [1 1]/2, but filters havingcoefficients such as [1 3]/4 and [1 7]/8 may be applied. The coefficientof the filter may be adaptively determined depending on the size of thecurrent block.

On the other hand, information of neighboring blocks may be furtherconsidered in performing the filtering on the left reference samples.For example, the modified values of the left boundary samples 620 may bederived as expressed by Expression 4, in consideration of variations ofthe sample values depending on they coordinate values of the leftboundary samples 620 with respect to the left-top reference sample 640.

predSamples[x,y]=p[x,−1]+(p[−1,y]−p[−1,−1]), with x=0, y=0 . . .nS−1  Expression 4

When the values of the left boundary samples 620 are derived using theabove-mentioned method, the values of the predicted sample may exceed adefined bit depth. Therefore, the values of the predicted samples may belimited to the defined bit depth or a weight may be given to thedifference therebetween. For example, in case of predicted samples oflama components, the modified values of the left boundary samples 620may be derived by Expression 5.

predSamples[x,y]=Clip1_(Y)(p[x,−1]+((p[−1,y]−p[−1,−1])/2)), with x=0,y=0 . . . nS−1  Expression 5

FIG. 7 is a diagram illustrating an example where the predictiondirection of an intra prediction mode according to an embodiment of theinvention is horizontal.

Referring to FIG. 7, in case of a horizontal prediction mode(Intra-Horizontal prediction mode), a smoothing filter may be applied totop boundary samples 720.

As described above, when a current block 700 is encoded in the verticalprediction mode, the values of the predicted samples are derived to bethe values of the left reference samples. Here, the reference samplesneighboring to the top boundary of the current block 700 are not usedfor the directional prediction, but are neighboring to the top boundarysamples of the current block 700. That is, in the top boundary samples720, the distance to the top reference samples 710 which are referencesamples not used for the prediction is smaller than the distance to theleft reference samples 730 which are reference samples used for theprediction. Here, the top reference samples 710 mean samples [x, −1]which are neighboring to the top boundary of the current block and whichhave the same x coordinate. The left reference samples 730 mean samples[−1, y] which are neighboring to the left boundary of the current blockand which have the same y coordinate. Therefore, since there is a highpossibility that the values of the top boundary samples 720 are similarto the values of the top reference samples 710, the smoothing filter maybe applied to the top boundary samples 720 as illustrated in FIG. 7. Theshaded portion 705 in the drawing represents a filtering target area.

For example, when a smoothing filter having a coefficient of [1 1]/2 isapplied, the modified values predSamples[x, y] of the top boundarysamples 720 can be derived by Expression 6.

predSamples[x,y]=(p[−1,y]+p[x,−1])/2, with x=0 . . . nS−1,y=0  Expression 6

The coefficient of the filter is not limited [1 1]/2, but filters havingcoefficients such as [1 3]/4 and [1 7]/8 may be applied. The coefficientof the filter may be adaptively determined depending on the size of thecurrent block.

On the other hand, information of neighboring blocks may be furtherconsidered in performing the filtering on the top reference samples. Forexample, the modified values of the top boundary samples 720 may bederived as expressed by Expression 7, in consideration of variations ofthe sample values depending on the x coordinate values of the topboundary samples 720 with respect to the left-top reference sample 740.

predSamples[x,y]=p[−1,y]+(p[x,−1]−p[−1,−1]), with x=0 . . . nS−1,y<0  Expression 7

When the values of the top boundary samples 720 are derived using theabove-mentioned method, the values of the predicted sample may exceed adefined bit depth. Therefore, the values of the predicted samples may belimited to the defined bit depth or a weight may be given to thedifference therebetween. For example, in case of predicted samples oflama components, the modified values of the top boundary samples 720 maybe derived by Expression 8.

predSamples[x,y]=Clip1_(X)(p[−1,x]+((p[x,−1]−p[−1,−1])/2)), with x=0 . .. nS−1, y=0  Expression 8

On the other hand, the method of applying the smoothing filter to theleft boundary samples or the top boundary samples on the basis of theprediction mode of the current block may be applied to other intradirectional prediction modes in addition to the vertical prediction modeand/or the horizontal prediction mode.

For example, the intra directional prediction modes may be classifieddepending on the prediction directions and the filtering may beadaptively performed depending on the groups to which the correspondingmode belongs.

FIG. 8 is a diagram illustrating an example where the intra predictionmodes are classified depending on the prediction directions.

When the prediction direction of an intra prediction mode is a top-rightdirection 810, the smoothing filter may be applied to the left boundarysamples, similarly to the vertical prediction mode. When the predictiondirection of an intra prediction mode is a left-bottom direction 820,the smoothing filter may be applied to the top boundary samples,similarly to the horizontal prediction mode.

FIG. 9 is a diagram illustrating an example where the predictiondirection of an intra prediction mode is the top-right directionaccording to an embodiment of the invention.

As described above, when a current block 900 is encoded in an intradirectional prediction mode of which the prediction direction is thetop-right direction, the values of the predicted samples are derived tobe values of reference samples 910 located in the prediction directionout of the reference samples neighboring to the right boundary of thecurrent block and a reference sample 910 located at the top-right edge.Here, the reference samples neighboring to the left boundary of thecurrent block 900 are not used, but are adjacent to the left boundarysamples. That is, the left boundary samples 920 have a distance to theleft reference samples 930 smaller than the distance to the referencesamples 910 located in the prediction direction. Here, the leftreference samples 930 mean samples [−1, y] which are neighboring to theleft boundary of the current block and which have the same y coordinate.Therefore, since there is a high possibility that the values of the leftboundary samples 920 are similar to the values of the adjacent leftreference samples 930, the smoothing filter may be applied to the leftboundary samples 920 as illustrated in FIG. 9. The shaded portion 905 inthe drawing represents a filtering target area.

FIG. 10 is a diagram illustrating an example where the predictiondirection of an intra prediction mode is the left-bottom directionaccording to an embodiment of the invention.

As described above, when a current block 1000 is encoded in an intradirectional prediction mode of which the prediction direction is theleft-bottom direction, the values of the predicted samples are derivedto be values of reference samples 1030 located in the predictiondirection out of the reference samples neighboring to the left boundaryof the current block and a reference sample located at the left-bottomedge. Here, the reference samples neighboring to the top boundary of thecurrent block 1000 are not used, but are neighboring to the top boundarysamples. That is, the top boundary samples 1020 have a distance to thetop reference samples 1010 smaller than the distance to the referencesamples 1030 located in the prediction direction. Here, the topreference samples 1010 mean samples [x, −1] which are neighboring to thetop boundary of the current block and which have the same x coordinate.Therefore, since there is a high possibility that the values of the topboundary samples 1020 are similar to the values of the adjacent topreference samples 1030, the smoothing filter may be applied to the topboundary samples 1020 as illustrated in FIG. 10. The shaded portion 1005in the drawing represents a filtering target area.

On the other hand, as described above, the procedure of deriving thevalues of the predicted samples has been described in two steps of thestep of deriving the values of the reference samples located in theprediction direction as the values of the predicted samples and the stepof filtering and modifying the boundary samples not located in theprediction direction out of the left boundary samples and the topboundary samples of the predicted block for the purpose of conveniencefor explanation, but the procedure of deriving the values of thepredicted samples may not be divided into plural steps, but may beperformed in a single step. For example, in the procedure of derivingthe values of the boundary samples not located in the predictiondirection out of the left boundary samples and the top boundary samplesof the predicted block, the step of filtering the boundary samples maynot be performed as an independent step, but may be performed as aunified step with the step of deriving the values of the predictedsamples to be the values of the reference samples located in theprediction direction.

For example, in the example illustrated in FIG. 6, the values of theleft boundary samples 620 may be derived on the basis of the topreference samples 610 and the reference samples 630 adjacent to the leftboundary samples as expressed by Expressions 3 to 5.

For example, in the example illustrated in FIG. 7, the values of the topboundary samples 720 may be derived on the basis of the left referencesamples 730 and the reference samples 710 adjacent to the top boundarysamples as expressed by Expressions 6 to 8.

For example, in the example illustrated in FIG. 9, the values of theleft boundary samples 920 may be derived on the basis of the referencesamples 910 located in the prediction direction and the referencesamples 930 adjacent to the left boundary samples.

For example, in the example illustrated in FIG. 10, the values of thetop boundary samples 1020 may be derived on the basis of the referencesamples 1030 located in the prediction direction and the referencesamples 1010 adjacent to the top boundary samples.

On the other hand, since the smoothing filtering is not performed on thepredicted samples other than the boundary samples not located in theprediction direction out of the left boundary samples and the topboundary samples of the predicted block, the values of the predictedsamples are derived to be the values of the reference samples in theprediction direction.

For example, when a current block is encoded in the vertical predictionmode, the values of predicted samples other than the left boundarysamples are derived as expressed by Expression 9.

predSamples[x,y]=p[x,−1], with x=1 . . . nS−1, y=0 . . .nS−1  Expression 9

For example, when a current block is encoded in the horizontalprediction mode, the values of predicted samples other than the topboundary samples are derived as expressed by Expression 10.

predSamples[x,y]=p[−1,y], with x=0 . . . nS−1, y=1 . . .nS−1  Expression 10

On the other hand, the method of applying the smoothing filter to theleft boundary samples or the top boundary samples on the basis of theprediction mode of the current block may not be applied to all thepredicted samples of the boundary samples, but may be applied to onlysome thereof.

When the distance to the reference samples used for the directionalprediction is small, the error of the predicted sample may not be large.In this case, it is rather accurate not to apply the smoothing filter,that is, not to consider other sample information. Therefore, it may bedetermined whether the filtering should be performed on the adjacentreference samples depending on the positions of the boundary samples inthe block.

For example, the smoothing filter may be applied to only some of theleft boundary samples in the vertical prediction mode, or the smoothingfilter may be applied to only some of the top boundary samples in thehorizontal prediction mode.

FIG. 11 is a diagram illustrating an example where the predictiondirection of an intra prediction mode is vertical according to anotherembodiment of the invention. Referring to FIG. 11, the smoothing filtermay be applied to only some of the left boundary samples. That is, thelarger the distance to the reference samples used for the predictionbecomes, the lower the prediction accuracy becomes. Accordingly, thesmoothing filter may be applied to only the samples in an area havinglow accuracy.

For example, the smoothing filter may be applied to only left boundarysamples 1120 spaced apart from top reference samples 1110 out of theleft boundary samples with respect to half the height of a current block1100. The shaded portion 1105 in the drawing represents a filteringtarget area.

Even when the prediction mode of a current block is the horizontalprediction mode, it may be determined whether the filtering should beperformed on the adjacent reference samples depending on the positionsof the top boundary samples in the block.

FIG. 12 is a diagram illustrating an example where the predictiondirection of an intra prediction mode is horizontal according to anotherembodiment of the invention. Referring to FIG. 12, the smoothing filtermay be applied to only some of the top boundary samples.

For example, the smoothing filter may be applied to only top boundarysamples 1220 spaced apart from left reference samples 1230 out of thetop boundary samples with respect to half the width of a current block1200. The shaded portion 1205 in the drawing represents a filteringtarget area.

On the other hand, the area to which the smoothing filter is applied isnot limited to half the height or width of the current block. That is,the area may be set to have a size of ¼ or ¾ thereof or may beadaptively determined on the basis of the distance to the samples usedfor the prediction depending on the intra prediction mode. In this case,the area to which the smoothing filter is applied may be defined in alookup table to reduce a computational load of the encoder or thedecoder.

On the other hand, the technical spirit of the invention can be appliedto both the luma component and the chroma component, but may be appliedto only the luma component and may not be applied to the chromacomponent. When the technical spirit of the invention is applied to onlythe luma component, the values of predicted samples of the chromacomponent are derived using the same method as in a general intraprediction mode.

FIG. 13 is a diagram schematically illustrating the operation of anencoder in a system according to the invention.

The encoder performs a prediction process on a current block (S1310).The encoder constructs a predicted block of the current block on thebasis of the prediction mode of the current block. Here, neighboringsamples of the current block may be used as reference samples to derivethe values of predicted samples.

When the prediction mode of the current block is an intra directionalprediction mode, the encoder may derive the values of boundary samplesnot located in the prediction direction of the intra directionalprediction mode out of the left boundary samples and the top boundarysamples of the predicted block on the basis of the reference sampleslocated in the prediction direction and the reference samples adjacentto the boundary samples. Here, the boundary samples mean samples whichare located in the predicted block and which are neighboring to theboundary of the predicted block.

For example, when the intra directional prediction mode is the verticalprediction mode, the encoder may derive the values of the left boundarysamples on the basis of the top reference samples of the left boundarysamples and the reference samples adjacent to the left boundary samples.Here, the top reference samples mean samples which are neighboring tothe top boundary of the current block and which have the same xcoordinate.

For example, when the intra directional prediction mode is the verticalprediction mode, the encoder may derive the values of the left boundarysamples on the basis of the top reference samples of the left boundarysamples, the reference samples adjacent to the left boundary samples,and the reference sample neighboring to the left-top edge of the currentblock.

For example, when the intra directional prediction mode is thehorizontal prediction mode, the encoder may derive the values of the topboundary samples on the basis of the left reference samples of the topboundary samples and the reference samples adjacent to the top boundarysamples. Here, the left reference samples mean samples which areneighboring to the left boundary of the current block and which have thesame y coordinate.

For example, when the intra directional prediction mode is thehorizontal prediction mode, the encoder may derive the values of the topboundary samples on the basis of the left reference samples of the topboundary samples, the reference samples adjacent to the top boundarysamples, and the reference sample neighboring to the left-top edge ofthe current block.

For example, when the prediction direction of the prediction mode is atop-right direction, the encoder may derive the values of the leftboundary samples on the basis of the reference samples located in theprediction direction and the reference samples adjacent to the leftboundary samples.

For example, when the prediction direction of the prediction mode is aleft-bottom direction, the encoder may derive the values of the topboundary samples on the basis of the reference samples located in theprediction direction and the reference samples adjacent to the topboundary samples.

On the other hand, the encoder may derive the values of the predictedsamples other than the boundary samples not located in the predictiondirection of the intra directional prediction mode out of the leftboundary samples and the top boundary samples of the predicted block tobe the values of the reference values located in the predictiondirection.

For example, when the intra directional prediction mode is the verticalprediction mode, the encoder may derive the values of the predictedsamples to be the values of the top reference samples of the predictedsamples.

For example, when the intra directional prediction mode is thehorizontal prediction mode, the encoder may derive the values of thepredicted samples to be the values of the left reference samples of thepredicted samples.

The encoder entropy-encodes information on the predicted blockconstructed in the prediction step S1310 (S1320). As described above,encoding methods such as exponential golomb and CABAC may be used forthe entropy encoding, and codewords may be allocated in consideration ofan appearance frequency of a prediction mode or a prediction type.

The encoder signals the information encoded in the entropy encoding stepS1320 (S1330). For example, the encoder may signal the prediction modeinformation and the residual signal between the predicted block and theoriginal block. When the smoothing filter is applied to the procedure ofperforming the intra prediction, the information on the coefficients ofthe smoothing filter may be signaled.

FIG. 14 is a diagram schematically illustrating the operation of adecoder in a system according to the invention.

The decoder receives information from an encoder (S1410). Theinformation received from the encoder may be supplied with a bitstreamhaving the information loaded thereon.

The decoder entropy-decodes the information received in the informationreceiving step S1410 (S1420). The decoder may acquire information forprediction of the current block, such as the prediction method (interprediction/intra prediction) of the current block, a motion vector(inter prediction), a prediction mode (intra prediction), and a residualsignal, in the entropy decoding step S1420.

The decoder performs a prediction process on the current block on thebasis of the information acquired in the entropy decoding step S1420(S1430). The decoder constructs a predicted block of the current blockon the basis of the prediction mode of the current block. Here,neighboring samples of the current block may be used as referencesamples so as to derive the values of the predicted samples.

The prediction method performed in the decoder is identical or similarto the prediction method performed in the encoder.

That is, when the prediction mode of the current block is an intradirectional prediction mode, the decoder may derive the values of theboundary samples not located in the prediction direction of the intradirectional prediction mode out of the left boundary samples and the topboundary samples of the predicted block on the basis of the referencesamples located in the prediction direction and the reference samplesadjacent to the corresponding boundary samples.

For example, the intra directional prediction mode is the verticalprediction mode, the decoder may derive the values of the left boundarysamples on the basis of the top reference samples of the left boundarysamples and the reference samples adjacent to the left boundary samples.

For example, the intra directional prediction mode is the verticalprediction mode, the decoder may derive the values of the left boundarysamples on the basis of the top reference samples of the left boundarysamples, the reference samples adjacent to the left boundary samples,and the reference sample neighboring to the left-top edge of the currentblock.

For example, the intra directional prediction mode is the horizontalprediction mode, the decoder may derive the values of the top boundarysamples on the basis of the left reference samples of the top boundarysamples and the reference samples adjacent to the top boundary samples.

For example, the intra directional prediction mode is the horizontalprediction mode, the decoder may derive the values of the top boundarysamples on the basis of the left reference samples of the top boundarysamples, the reference samples adjacent to the top boundary samples, andthe reference sample adjacent to the left-top edge of the current block.

For example, when the prediction direction of the prediction mode is atop-right direction, the decoder may derive the values of the leftboundary samples on the basis of the reference samples located in theprediction direction and the reference samples adjacent to the leftboundary samples.

For example, when the prediction direction of the prediction mode is aleft-bottom direction, the encoder may derive the values of the topboundary samples on the basis of the reference samples located in theprediction direction and the reference samples adjacent to the topboundary samples.

The decoder may derive the values of the predicted samples other thanthe boundary samples not located in the prediction direction of theintra directional prediction mode out of the left boundary samples andthe top boundary samples of the predicted block to be the values of thereference samples located in the prediction direction.

For example, when the intra directional prediction mode is the verticalprediction mode, the decoder may derive the values of the predictedsamples to be the values of the top reference samples of the predictedsamples.

For example, when the intra directional prediction mode is thehorizontal prediction mode, the decoder may derive the values of thepredicted samples to be the values of the left reference samples of thepredicted samples.

The decoder reconstructs a picture on the basis of the predicted blockconstructed in the prediction step S1430 (S1440).

While the methods in the above-mentioned exemplary system have beendescribed on the basis of flowcharts including a series of steps orblocks, the invention is not limited to the order of steps and a certainstep may be performed in a step or an order other than described aboveor at the same time as described above. The above-mentioned embodimentscan include various examples. Therefore, the invention includes allsubstitutions, corrections, and modifications belonging to the appendedclaims.

When it is mentioned above that an element is “connected to” or “coupledto” another element, it should be understood that still another elementmay be interposed therebetween, as well as that the element may beconnected or coupled directly to another element. On the contrary, whenit is mentioned that an element is “connected directly to” or “coupleddirectly to” another element, it should be understood that still anotherelement is not interposed therebetween.

1-15. (canceled)
 16. A method for decoding video using intra predictionby decoding apparatus, the method comprising: determining intraprediction mode for a current block based on prediction mode informationobtained from bitstream; deriving a prediction sample of the currentblock based on reference samples specified by the intra prediction mode;filtering the prediction sample adjacent to a reference sample which isnot used for deriving the prediction sample; and deriving areconstructed sample of the current block based on the prediction sampleof the current block, wherein in the step of filtering the predictionsample includes perform filtering on the prediction sample using thereference sample which is not used for deriving the prediction sample.17. The method of claim 16, wherein in the step of determining intraprediction mode, the intra prediction mode is determined as one ofangular prediction modes categorized with 34 directions.
 18. The methodof claim 16, wherein in the step of determining intra prediction mode,the intra prediction mode is determined as vertical intra predictionmode, wherein the step of deriving a prediction sample of the currentblock includes deriving the prediction sample based on a referencesample neighboring to a top boundary of the current block; and whereinthe step of filtering includes performing a filtering on a predictionsample adjacent to a left boundary of the current block among derivedprediction samples in the current block, using a reference sampleneighboring to the left boundary of the current block.
 19. The method ofclaim 18, wherein the vertical intra prediction mode indicates that aprediction sample of the current block is derived using a referencesample having the same x coordinate with the prediction sample.
 20. Themethod of claim 18, wherein the reference sample used for the filteringon the prediction sample is a reference sample having the same ycoordinate with the prediction sample to be filtered.
 21. The method ofclaim 18, wherein the reference sample to be used for the filtering onthe prediction sample is a reference sample adjacent to the left of theprediction sample to be filtered.
 22. The method of claim 16, wherein inthe step of determining intra prediction mode, the intra prediction modeis determined as horizontal intra prediction mode, wherein the step ofderiving a prediction sample of the current block comprises deriving theprediction sample based on a reference sample neighboring to a leftboundary of the current block; and wherein the step of filteringcomprises performing a filtering on a prediction sample adjacent to atop boundary of the current block among derived prediction samples inthe current block, using a reference sample neighboring to the topboundary of the current block.
 23. The method of claim 22, wherein thehorizontal intra prediction mode indicates that a prediction sample ofthe current block is derived using a reference sample having the same ycoordinate with the prediction sample.
 24. The method of claim 22,wherein the reference sample used for the filtering on the predictionsample is a reference sample having the same x coordinate with theprediction sample to be filtered.
 25. The method of claim 22, whereinthe reference sample to be used for the filtering on the predictionsample is a reference sample adjacent to top of the prediction sample tobe filtered.
 26. The method of claim 16, wherein in the step offiltering the prediction sample, a filtering coefficient applied to theprediction sample is larger than a filtering coefficient applied to thereference sample.